import { useEffect, useState } from 'react'
import { fetchFullName } from '../../moex/fetch-full-name'

export const useGetFullName = (name: string) => {
    const [fullName, setFullName] = useState<string | null>(null)

    useEffect(() => {
        fetchFullName(name).then((d) => setFullName(d))
    }, [])


    return { fullName }
}